home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 6.1 KB | 220 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Content.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CONTENT_H
- #define CONTENT_H
-
- #ifndef PROXY_H
- #include "Proxy.h"
- #endif
-
- #ifndef ITERS_H
- #include "Iters.h"
- #endif
-
- // ----- Part Layer -----
-
- #ifndef FWCONTNG_H
- #include "FWContng.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class CContainerPart;
- class CProxyCollection;
- class CProxy;
- class CContentProxyIterator;
- class CContainerSelection;
-
- //========================================================================================
- // class CBaseContent
- //========================================================================================
-
- class CBaseContent : public FW_CEmbeddingContent
- {
- public:
- friend class CContentProxyIterator;
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
-
- FW_DECLARE_AUTO(CBaseContent)
-
- CBaseContent(Environment* ev, CContainerPart* part);
- CBaseContent(Environment* ev, CBaseContent* other);
-
- virtual ~CBaseContent();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_MProxy* IsDataOnlyOneProxy(Environment* ev) const;
-
- //----------------------------------------------------------------------------------------
- // Overridable API
- //
- public:
- virtual void PostInternalizeProxy(Environment* ev,
- const FW_CPoint& offset,
- CProxy* proxy);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- CProxy* AddSingleEmbeddedFrame(Environment* ev,
- FW_CEmbeddingFrame* scopeFrame,
- ODPart* odEmbeddedPart,
- ODFrame* odEmbeddedFrame,
- ODShape* suggestedShape,
- ODTypeToken viewType);
-
- void ExternalizeProxyList(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo,
- FW_Fixed offsetX,
- FW_Fixed offsetY);
- void InternalizeProxyList(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
-
- void AddProxy(Environment* ev, CProxy* proxy);
- void RemoveProxy(Environment* ev, CProxy* proxy);
-
- ODShape* CalcUpdateShape(Environment* ev);
- void RedrawProxies(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Getters & Setters
- //
- public:
- unsigned long CountProxies() const;
- FW_Boolean IsEmpty() const;
- CProxy* GetFirstProxy() const;
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- CProxyCollection* fProxyList; // list of CProxy*
- CContainerPart* fContainerPart;
- };
-
- //========================================================================================
- // class CContentProxyIterator
- //========================================================================================
-
- class CContentProxyIterator : public CProxyCollectionIterator
- {
- public:
-
- FW_DECLARE_AUTO(CContentProxyIterator)
-
- public:
- CContentProxyIterator(CBaseContent* content);
- ~CContentProxyIterator();
- };
-
- //========================================================================================
- // class CPartContent
- //========================================================================================
-
- class CPartContent : public CBaseContent
- {
- public:
-
- FW_DECLARE_AUTO(CPartContent)
-
- CPartContent(Environment* ev, CContainerPart* part);
- virtual ~CPartContent();
-
- virtual void Externalize(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_EStorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
- virtual FW_Boolean Internalize(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_EStorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
-
- virtual void PostInternalizeProxy(Environment* ev,
- const FW_CPoint& offset,
- CProxy* proxy);
- };
-
- //========================================================================================
- // class CSelectionContent
- //========================================================================================
-
- class CSelectionContent : public CBaseContent
- {
- public:
-
- FW_DECLARE_AUTO(CSelectionContent)
-
- CSelectionContent(Environment* ev,
- CContainerPart* part,
- CContainerSelection* selection);
- virtual ~CSelectionContent();
-
- virtual void Externalize(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_EStorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
-
- virtual FW_Boolean Internalize(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_EStorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
-
- virtual void PostInternalizeProxy(Environment* ev,
- const FW_CPoint& offset,
- CProxy* proxy);
-
- virtual void SingleEmbeddedFrameInternalized(Environment* ev,
- FW_CEmbeddingFrame* scopeFrame,
- ODPart* embeddedPart,
- ODFrame* embeddedFrame,
- ODShape* suggestedShape,
- ODTypeToken viewType);
-
- virtual ODShape* CreateDataFrameShape(Environment* ev) const;
-
- private:
- CContainerSelection* fContainerSelection;
- };
-
- //========================================================================================
- // class CUndoContent
- //========================================================================================
-
- class CUndoContent : public CBaseContent
- {
- public:
-
- FW_DECLARE_AUTO(CUndoContent)
-
- CUndoContent(Environment* ev, CContainerSelection* selection);
- virtual ~CUndoContent();
-
- // ----- New API -----
- void RemoveProxySelection(Environment* ev);
- void RestoreProxySelection(Environment* ev);
- void DeleteSavedProxies(Environment* ev);
-
- private:
- CContainerSelection* fContainerSelection;
- };
-
- #endif